﻿<Window x:Class="P2.Cuberry.Modules.Framework.ApplicationConfigurator.ApplicationConfiguratorDetailsView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"  
    xmlns:basec="clr-namespace:P2.Cuberry.Framework.Helper;assembly=P2.Cuberry.Framework.Helper" 
        
        
        Icon="/P2.Cuberry;component/Images/CuberryIcon32.ico"
        Title="Peacequare Cuberry" Width="920" Height="480"  
        Background="{DynamicResource P2BackgroundBrush}" 
        Closing="Window_Closing"
        >

    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/P2.Cuberry.Framework.Layout;component/Styles/Styles.xaml"/>
                <ResourceDictionary Source="/P2.Cuberry.Framework.Layout;component/Styles/CuberryDataGrid.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Window.Resources>

    <Grid>
        <Grid.Resources>
            <Image x:Key="SaveIcon" Height="16" Width="16" Source="/P2.Cuberry.Modules.Framework.ApplicationConfigurator;component/Images/save.png" />
            <Image x:Key="CancelIcon" Height="16" Width="16" Source="/P2.Cuberry.Modules.Framework.ApplicationConfigurator;component/Images/cancel.png" />
            <Image x:Key="ClosingIcon" Height="16" Width="16" Source="/P2.Cuberry.Modules.Framework.ApplicationConfigurator;component/Images/save.png" />

            <Image x:Key="Printer2Icon" Height="16" Width="16" Source="/P2.Cuberry.Modules.Framework.ApplicationConfigurator;component/Images/printer2.png" />


        </Grid.Resources>


        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>

        <Grid.RowDefinitions>
            <RowDefinition Height="40" />
            <RowDefinition Height="35" />
            <RowDefinition Height="*"/>
            <RowDefinition Height="35" />
        </Grid.RowDefinitions>

        <!-- Row 0 Start -->        
        <Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3" Content="{Translate DialogHeaderApplicationConfiguratorDetail}" Style="{StaticResource P2DetailViewHeaderTextStyle}" />
        
        <Separator Margin="0,0,0,0" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3" VerticalAlignment="Bottom" Height="0"/>
        <!-- Row 0 End -->

        <!-- Row 1: Menu Start -->
        <Border  Grid.Row="1" Grid.Column="0"  Style="{StaticResource P2MenuBorderStyle}">
            <Menu Grid.Row="1" x:Name="menuMain" Style="{StaticResource P2MenuStyle}" >
                <MenuItem x:Name="SaveBtn" Margin="2,1,0,2"  InputGestureText="Ctrl+S" Header="{Translate SaveBtn}" Command="{Binding HREmployeeSaveCommand}"  Icon="{StaticResource SaveIcon}" Style="{StaticResource P2MenuItemStyle}" />
                <MenuItem x:Name="CloseBtn" Margin="2,1,0,2" InputGestureText="Ctrl+X" Header="{Translate SaveAndCloseBtn}" Command="{Binding HREmployeeCloseCommand}" Icon="{StaticResource CancelIcon}" Style="{StaticResource P2MenuItemStyle}"/>
                                
                <MenuItem x:Name="PrintBtn" Margin="2,1,0,2" Header="{Translate PrintBtn}" Click="PrintBtn_Click" Icon="{StaticResource Printer2Icon}" Style="{StaticResource P2MenuItemStyle}"/>

            </Menu>
        </Border>


        <!-- Row 1 End -->

        <!-- Row 2: All Fields -->
        <Border  Grid.Row="2" Grid.Column="0"  Style="{StaticResource P2ContentBorderStyle}">
            <Grid Grid.Row="2" Grid.Column="0">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="604*"/>
                    <ColumnDefinition Width="0*" />
                </Grid.ColumnDefinitions>

                <Grid.RowDefinitions>
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>
                <Label Margin="22,14,0,0" Name="ReportingServerL" Height="28" VerticalAlignment="Top" Content="{Translate ReportingServerL}" HorizontalAlignment="Left" Width="120"></Label>
                <TextBox Margin="22,35,0,0" Name="ReportingServer" Height="23"  Text="{Binding Model.ReportingServer, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{StaticResource ErrorTemplate}" Style="{StaticResource P2TextBoxStyle}" VerticalAlignment="Top" HorizontalAlignment="Left" Width="247.47" IsReadOnly="True" />

                <Label Content="{Translate ReportsLocationL}" Height="28" HorizontalAlignment="Left" Margin="22,56,0,0" Name="ReportsLocationL" VerticalAlignment="Top" Width="120" />
                <TextBox Margin="22,78,0,0" Name="ReportsLocation"  Height="23" Style="{StaticResource P2TextBoxStyle}" Text="{Binding Model.ReportsLocation, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{StaticResource ErrorTemplate}"  VerticalAlignment="Top"  HorizontalAlignment="Left" Width="247.47" IsReadOnly="True" />

                <Label Content="{Translate WordTemplateLocationL}" Height="28" HorizontalAlignment="Left" Margin="22,99,0,0" Name="WordTemplateLocationL" VerticalAlignment="Top" Width="120" />
                <TextBox Margin="22,120,0,0" Name="WordTemplateLocation"  Height="23" Style="{StaticResource P2TextBoxStyle}" Text="{Binding Model.WordTemplateLocation, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{StaticResource ErrorTemplate}"  VerticalAlignment="Top" HorizontalAlignment="Left" Width="247.47" IsReadOnly="True" />
                <Label Content="{Translate FallbackLanguageL}" Height="28" HorizontalAlignment="Left" Margin="22,205,0,0" Name="FallbackLanguageL" VerticalAlignment="Top" Width="120" />
                <ComboBox DisplayMemberPath="FallbackLanguage" Grid.RowSpan="2" Height="23.723" HorizontalAlignment="Left" IsEnabled="{Binding IsEditable}" ItemsSource="ApplicationLanguages" Margin="22,225,0,0" Name="FallbackLanguage" SelectedValue="{Binding FallbackLanguageID, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" SelectedValuePath="FallbackLanguageID" Style="{StaticResource P2ComboBoxStyle}" Validation.ErrorTemplate="{StaticResource ErrorTemplate}" VerticalAlignment="Top" Width="120" />
                <TabControl Margin="341,3,3,3" Name="tabControl1" MinWidth="540" BorderBrush="{DynamicResource P2BackgroundBrush}" Height="317" Width="540">

                    <TabItem Header="Application Languages" Name="ApplicationLanguagesTab" Background="White" >
                        <Border Margin="5,0,5,5"   VerticalAlignment="Stretch" BorderThickness="1" CornerRadius="2,2,2,2" BorderBrush="#FF6893CF">
                            <Grid ShowGridLines="False">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="20"/>
                                    <RowDefinition Height="*"/>
                                    <RowDefinition Height="34"/>
                                </Grid.RowDefinitions>

                                <DataGrid Grid.Row="1"  Margin="3,0,3,0" 
                                             Name="ApplicationLanguageList" 
                                             ItemsSource="{Binding ApplicationResources}"
                                             
                                             Style="{DynamicResource CuberryDataGridStyle}"
                                             VerticalAlignment="Top" >
                                    
                                    <DataGrid.Columns>
                                        <DataGridTextColumn   Header="{Translate LanguageIDL}" IsReadOnly="True"  Binding="{Binding LanguageID}" 
                                                              Width="*" MinWidth="40" />
                                        <DataGridCheckBoxColumn   Header="{Translate RighToLeftL}" IsReadOnly="True"  Binding="{Binding RighToLeft}" 
                                                              Width="100" MinWidth="40" />

                                    </DataGrid.Columns>
                                </DataGrid>
                                <Button Grid.Row="2" HorizontalAlignment="Right" VerticalAlignment="Bottom"  Margin="3,3,3,3" Name="AddLanguageBtn"  Command="{Binding ApplicationConfigurationAddLanguageCommand}"  Height="23" Width="23">
                                    <Image  Source="/P2.Cuberry.Modules.Framework.ApplicationConfigurator;component/Images/add.png"></Image>
                                </Button>
                            </Grid>
                        </Border>
                    </TabItem>


                    <TabItem Header="Application Resources" Name="ApplicationResourcesTab" Background="White" >
                        <Border Margin="5,0,5,5"   VerticalAlignment="Stretch" BorderThickness="1" CornerRadius="2,2,2,2" BorderBrush="#FF6893CF">
                            <Grid ShowGridLines="False">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="55"/>
                                    <RowDefinition Height="*"/>
                                    <RowDefinition Height="34"/>
                                </Grid.RowDefinitions>

                                <Label Content="{Translate ResourceNameFindL}" Height="28" HorizontalAlignment="Left" Margin="10,4,0,0" Name="ResourceNameFindL" VerticalAlignment="Top" Width="120" />
                                <TextBox Height="23" HorizontalAlignment="Left" Margin="10,24,0,0" Name="ResourceNameFind" Style="{StaticResource P2TextBoxStyle}" Text="{Binding Model.ResourceNameFind, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{StaticResource ErrorTemplate}" VerticalAlignment="Top" Width="247.47" />

                                <DataGrid Grid.Row="1"  Margin="3,10,3,0" 
                                             Name="ApplicationResourceList" 
                                             ItemsSource="{Binding ApplicationResources}"
                                             Style="{DynamicResource CuberryDataGridStyle}"
                                             VerticalAlignment="Top" >
                                    
                                    <DataGrid.Columns>
                                        <DataGridTextColumn   Header="{Translate ResourceNameL}" IsReadOnly="True"  Binding="{Binding ResourceName}" 
                                                              Width="100" MinWidth="40" />
                                        <DataGridTextColumn   Header="{Translate ResourceLanguageL}" IsReadOnly="True"  Binding="{Binding ResourceLanguage}" 
                                                              Width="100" MinWidth="40" />
                                        <DataGridTextColumn   Header="{Translate ResourceTextL}" IsReadOnly="True"  Binding="{Binding ResourceText}" 
                                                              Width="*" MinWidth="40" />

                                    </DataGrid.Columns>
                                </DataGrid>
                                <Button Grid.Row="2" HorizontalAlignment="Right" VerticalAlignment="Bottom"  Margin="3,3,3,3" Name="AddResourceBtn"  Command="{Binding ApplicationConfigurationAddResourceCommand}"  Height="23" Width="23">
                                    <Image  Source="/P2.Cuberry.Modules.Framework.ApplicationConfigurator;component/Images/add.png"></Image>
                                </Button>
                            </Grid>
                        </Border>
                    </TabItem>

                    
                </TabControl>
            </Grid>
        </Border>

        <!-- Row 2: End -->


        <!-- Row 3: Bottom: Status Bar Start -->
        <Border Grid.Row="3" Grid.Column="0" Style="{StaticResource P2StatusStripBorderStyle}" >
            <Grid Grid.Row="3" Grid.Column="0" Style="{StaticResource P2StatusStripGridStyle}">
                <basec:P2StatusStrip x:Name="StatusStrip" MessageStack2="{Binding MessageStack}"  Grid.Column="0" Grid.Row="3" Height="Auto" Width="Auto" Background="White" HorizontalAlignment="Left" ContentStringFormat=""></basec:P2StatusStrip>
                <TextBox Name="Status" Grid.Column="0" Grid.Row="3" Height="Auto" Width="Auto" Background="White" HorizontalAlignment="Right" Text="{Binding Model.StatusName, Mode=OneWay}" IsReadOnly="True" BorderBrush="Transparent" />
            </Grid>
        </Border>

        <!-- Row 3: End -->
    </Grid>
</Window>
